*************************************************************************************************
********************************** REPLICATION MATERIALS (II) *********************************** 
******************* Identities, causal antecedents and support for secession ********************
*************************************************************************************************

clear all
capture cd Set own path 

do doclean
set scheme plotplainblind

***************************************** MAIN ANALYSIS *****************************************
**Test for linearily in Ancestry 
logit secession language ancestry_cont i.ancestry speak_cat ideol female i.education age, cluster(BOP_NUM) 
test 2*i2.ancestry = 1*i3.ancestry
tab ancestry_cont origin, row nofreq

**Brant test for parallel regression assumption
ologit ins4cat language ancestry_cont, cluster(BOP_NUM)
omodel logit ins4cat language ancestry_cont
brant, detail

**Table 1. Structural Equations Model
global sem1 "(language -> 2.ins4cat, family(multinomial) link(logit)) (language -> 3.ins4cat, family(multinomial) link(logit)) (language -> secession, family(bernoulli) link(logit)) (language ->  4.ins4cat, family(multinomial) link(logit)) (2.ins4cat -> secession, family(bernoulli) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (ancestry_cont -> language, family(binomial) link(logit)) (ancestry_cont -> 2.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> 3.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (ancestry_cont -> 4.ins4cat, family(multinomial) link(logit)) (3.ins4cat -> secession, family(bernoulli) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (female -> secession, family(bernoulli) link(logit)) (age -> secession, family(bernoulli) link(logit)) (4.ins4cat -> secession, family(bernoulli) link(logit)) (3.education -> secession, family(bernoulli) link(logit))"

global cluster ", vce(cluster BOP_NUM) nocapslatent"
global controls "speak_cat ideol female 2.education 3.education age"

gsem $sem1 $cluster

eststo language
eststo ancestry_cont
eststo ideol
eststo ins4cat
eststo female
eststo age
eststo education

esttab . using table1.rtf, b(3) se(3) scalars("ll Log lik.") nobase label star(+ .1 * .05 ** .01 *** .001)  nogap mtitle(Identity Secession Language) unstack replace 

**Figure 2. Identity placement and support for secession
mlogit ins4catb language ancestry_cont, cluster(BOP_NUM)
margins, at(language=(0 1)) vsquish
marginsplot, title("Language", size(medlarge)) xlabel(0 "Spanish" 1 "Catalan") ytitle("National-regional identity", size(small) height(3)) xtitle("Language first spoke at home", height(4)) legend(order(0 "Identity:" 5 "More Spanish than Catalan" 6 "Dual identity" 7 "More Catalan than Spanish" 8 "Only Catalan") col(5) size(vsmall)) name(ins_language_mlog, replace) 

margins, at(ancestry_cont=(0 0.5 1)) vsquish
marginsplot, title("Ancestry", size(medlarge)) xlabel(0 "Outside Catalonia" 0.5 "One in Catalonia" 1 "In Catalonia") ytitle("National-regional identity", size(small) height(3)) xtitle("Parents born in...", height(4)) legend(order(0 "Identity:" 5 "More Spanish than Catalan" 6 "Dual identity" 7 "More Catalan than Spanish" 8 "Only Catalan") size(vsmall)) name(ins_ancestry_cont_mlog, replace) 
grc1leg ins_language_mlog ins_ancestry_cont_mlog, title(National-regional identity, size(medsmall)) name(combine_identity_mlog, replace)

logit secession i.ins4cat language ancestry_cont speak_cat ideol female i.education age, cluster(BOP_NUM)
margins, at(ins4cat=(1 2 3 4)) 
margins, at(ins4cat=(1 2 3 4) language=(0 1))
marginsplot , title(Language, size(medlarge)) xlabel(1 `""More Spanish" "than Catalan""' 2 `""Dual" "identity""' 3 `""More Catalan" "than Spanish""' 4 `""Only" "Catalan""') xtitle("Identity", height(4)) ytitle("Support for secession", size(small) height(3)) legend(order(0 "Language first spoken:" 3 "Spanish/others" 4 "Catalan") row(2) pos(6) col(3)) name(secession_language_mlog, replace) 

logit secession i.ins4cat language ancestry_cont speak_cat ideol female i.education age, cluster(BOP_NUM) 
margins, at(ins4cat=(1 2 3 4) ancestry_cont=(0 0.5 1))
marginsplot, title("Ancestry", size(medlarge)) xlabel(1 `""More Spanish" "than Catalan""' 2 `""Dual" "identity""' 3 `""More Catalan" "than Spanish""' 4 `""Only" "Catalan""') xtitle("Identity", height(4))  ytitle("Support for secession", size(small) height(3)) legend(order(0 "Parents born:" 4 "Outside Catalonia" 5 "One parent Catalonia" 6 "Catalonia") pos(6) row(2)) name(secession_ancestry_cont_mlog, replace) 
 
graph combine secession_language_mlog secession_ancestry_cont_mlog, title("Support for secession", size(medsmall)) name(combine_secession_mlog, replace)

graph combine combine_identity_mlog combine_secession_mlog, xsize(4) ysize(4) col(1) name(figure2, replace)
graph export figure2.png, replace
 
**Table 2. Direct, indirect, and total effects for the fitted model for language and the ancestry_cont
quiet gsem (language -> 2.ins4cat, family(multinomial) link(logit)) (language -> 3.ins4cat, family(multinomial) link(logit)) (language -> secession, family(bernoulli) link(logit)) (language -> 4.ins4cat, family(multinomial) link(logit)) (2.ins4cat -> secession, family(bernoulli) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (ancestry_cont -> language, family(binomial) link(logit)) (ancestry_cont -> 2.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> 3.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (ancestry_cont -> 4.ins4cat, family(multinomial) link(logit)) (3.ins4cat -> secession, family(bernoulli) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (female -> secession, family(bernoulli) link(logit)) (age -> secession, family(bernoulli) link(logit)) (4.ins4cat -> secession, family(bernoulli) link(logit)) (3.education -> secession, family(bernoulli) link(logit)), vce(cluster BOP_NUM) nocapslatent

foreach var of varlist language ancestry_cont {
forvalues i=2/4 {
*indirect language
nlcom _b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]
*direct language
nlcom _b[secession:`var']
*total language
nlcom (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var'])
*% indirect language
nlcom  (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) / ((_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var']))
}
}

***************************************** ROBUSTNESS CHECKS *****************************************

***A2a. Descriptive statistics for the dependent, mediator and independent variables
quiet gsem $sem1 $cluster
tab ins4cat, gen(ins4_)
tab education, gen(education)

sum secession ins4_1 ins4_2 ins4_3 ins4_4 language ancestry_cont ideol speak_cat  age female education1 education2 education3 

***A3a. Direct and indirect effects of language and ancestry on national-regional identity and support for secession

sembuilder "C:\Users\1407091\Google Drive\Papers\Revisiting the Linz-Moreno\Data\Replication files\SEM_1RR.stsem"

***A4.1. Control variables as antecedents of identity

**Table A4.1a. SEM estimation using all control variables as antecedents and an ordinal measure of national-regional identity
gsem (language -> 2.ins4cat, family(multinomial) link(logit)) (language -> 3.ins4cat, family(multinomial) link(logit)) (language -> secession, family(bernoulli) link(logit)) (language -> 4.ins4cat, family(multinomial) link(logit)) (2.ins4cat -> secession, family(bernoulli) link(logit)) (speak_cat -> 2.ins4cat, family(multinomial) link(logit)) (speak_cat -> 3.ins4cat, family(multinomial) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (speak_cat -> 4.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> language, family(binomial) link(logit)) (ancestry_cont -> 2.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> 3.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (ancestry_cont -> 4.ins4cat, family(multinomial) link(logit)) (3.ins4cat -> secession, family(bernoulli) link(logit)) (2.education -> 2.ins4cat, family(multinomial) link(logit)) (2.education -> 3.ins4cat, family(multinomial) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (2.education -> 4.ins4cat, family(multinomial) link(logit)) (ideol -> 2.ins4cat, family(multinomial) link(logit)) (ideol -> 3.ins4cat, family(multinomial) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (ideol -> 4.ins4cat, family(multinomial) link(logit)) (female -> 2.ins4cat, family(multinomial) link(logit)) (female -> 3.ins4cat, family(multinomial) link(logit)) (female -> secession, family(bernoulli) link(logit)) (female -> 4.ins4cat, family(multinomial) link(logit)) (age -> 2.ins4cat, family(multinomial) link(logit)) (age -> 3.ins4cat, family(multinomial) link(logit)) (age -> secession, family(bernoulli) link(logit)) (age -> 4.ins4cat, family(multinomial) link(logit)) (4.ins4cat -> secession, family(bernoulli) link(logit)) (3.education -> 2.ins4cat, family(multinomial) link(logit)) (3.education -> 3.ins4cat, family(multinomial) link(logit)) (3.education -> secession, family(bernoulli) link(logit)) (3.education -> 4.ins4cat, family(multinomial) link(logit)), vce(cluster BOP_NUM) nocapslatent

eststo language
eststo ancestry_cont
eststo ideol
eststo ins4cat
eststo female
eststo age
eststo education

esttab . using tableA41a.rtf, b(3) se(3) scalars("ll Log lik.") nobase label star(+ .1 * .05 ** .01 *** .001)  nogap mtitle(Identity Secession Language ) unstack replace 

**Table A4.1b. Percentage of indirect effects for the fitted model for language and the ancestry_cont using all control variables as antecedents of identity
quiet gsem (language -> 2.ins4cat, family(multinomial) link(logit)) (language -> 3.ins4cat, family(multinomial) link(logit)) (language -> secession, family(bernoulli) link(logit)) (language -> 4.ins4cat, family(multinomial) link(logit)) (2.ins4cat -> secession, family(bernoulli) link(logit)) (speak_cat -> 2.ins4cat, family(multinomial) link(logit)) (speak_cat -> 3.ins4cat, family(multinomial) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (speak_cat -> 4.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> language, family(binomial) link(logit)) (ancestry_cont -> 2.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> 3.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (ancestry_cont -> 4.ins4cat, family(multinomial) link(logit)) (3.ins4cat -> secession, family(bernoulli) link(logit)) (2.education -> 2.ins4cat, family(multinomial) link(logit)) (2.education -> 3.ins4cat, family(multinomial) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (2.education -> 4.ins4cat, family(multinomial) link(logit)) (ideol -> 2.ins4cat, family(multinomial) link(logit)) (ideol -> 3.ins4cat, family(multinomial) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (ideol -> 4.ins4cat, family(multinomial) link(logit)) (female -> 2.ins4cat, family(multinomial) link(logit)) (female -> 3.ins4cat, family(multinomial) link(logit)) (female -> secession, family(bernoulli) link(logit)) (female -> 4.ins4cat, family(multinomial) link(logit)) (age -> 2.ins4cat, family(multinomial) link(logit)) (age -> 3.ins4cat, family(multinomial) link(logit)) (age -> secession, family(bernoulli) link(logit)) (age -> 4.ins4cat, family(multinomial) link(logit)) (4.ins4cat -> secession, family(bernoulli) link(logit)) (3.education -> 2.ins4cat, family(multinomial) link(logit)) (3.education -> 3.ins4cat, family(multinomial) link(logit)) (3.education -> secession, family(bernoulli) link(logit)) (3.education -> 4.ins4cat, family(multinomial) link(logit)), vce(cluster BOP_NUM) nocapslatent

foreach var of varlist language ancestry_cont speak_cat ideol {
forvalues i=2/4 {
*indirect language
*nlcom _b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]
*direct language
*nlcom _b[secession:`var']
*total language
*nlcom (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var'])
*% indirect language
nlcom  (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) / ((_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var'])), level(95)
}
}

***A4.2. Disaggregation of the results by year

**Table A4.2a. Percentage of indirect effects for the fitted model for the language and the ancestry, by year
forvalues i = 2015/2019{
preserve 
keep if ANY==`i'
tab ANY
quiet gsem $sem1  $cluster    
foreach var of varlist language ancestry_cont {
forvalues i=2/4 {
*indirect language
*nlcom _b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]
*direct language
*nlcom _b[secession:`var']
*total language
*nlcom (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var'])
*% indirect language
nlcom  (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) / ((_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var']))
}
}
restore
}

***A4.3. Ordinal measure of national-regional identity
**Table A4.3a. Structural Equations Model using an ordinal measure of national-regional identity
global sem1ord "(language -> ins4cat, family(ordinal) link(logit)) (language -> secession, family(bernoulli) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (ancestry_cont -> language, family(bernoulli) link(logit)) (ancestry_cont -> ins4cat, family(ordinal) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (female -> secession, family(bernoulli) link(logit)) (ins4cat -> secession, family(bernoulli) link(logit)) (age -> secession, family(bernoulli) link(logit)) (3.education -> secession, family(bernoulli) link(logit))"

gsem $sem1ord $cluster

eststo language
eststo ancestry_cont
eststo ideol
eststo ins4cat
eststo female
eststo age
eststo education

esttab . using tableA43a.rtf, b(3) se(3) scalars("ll Log lik.") nobase label star(+ .1 * .05 ** .01 *** .001)  nogap mtitle(Identity Secession ) unstack replace 

**Figure A4.3a. Identity placement and support for secession
gsem (language ancestry_cont -> ins4catb, family(ordinal) link(logit))
ologit ins4catb language ancestry_cont
margins, at(language=(0 1)) vsquish
marginsplot, title("Language", size(medlarge)) xlabel(0 "Spanish" 1 "Catalan") ytitle("National-regional identity", size(small) height(3)) xtitle("Language first spoke at home", height(4)) legend(order(0 "Identity:" 5 "More Spanish than Catalan" 6 "Dual identity" 7 "More Catalan than Spanish" 8 "Only Catalan") col(5) size(vsmall)) name(ins_language_olog, replace) 

margins, at(ancestry_cont=(0 0.5 1)) vsquish
marginsplot, title("Ancestry", size(medlarge)) xlabel(0 "Outside Catalonia" 0.5 "One in Catalonia" 1 "In Catalonia") ytitle("National-regional identity", size(small) height(3)) xtitle("Parents born in...", height(4)) legend(order(0 "Identity:" 5 "More Spanish than Catalan" 6 "Dual identity" 7 "More Catalan than Spanish" 8 "Only Catalan") size(vsmall)) name(ins_ancestry_olog, replace) 

grc1leg ins_language_olog ins_ancestry_olog, title(National-regional identity, size(medsmall)) name(combine_identity_olog, replace)

gsem (ins4cat language ancestry_cont $controls -> secession, family(bernoulli) link(logit)) 
margins, at(ins4cat=(1 2 3 4) language=(0 1)) predict(outcome(secession))
marginsplot , title(Language, size(medlarge)) xlabel(1 `""More Spanish" "than Catalan""' 2 `""Dual" "identity""' 3 `""More Catalan" "than Spanish""' 4 `""Only" "Catalan""') xtitle("Identity", height(4)) ytitle("Support for secession", size(small) height(3)) legend(order(0 "Language first spoken:" 3 "Spanish/others" 4 "Catalan") row(2) pos(6) col(3)) name(secession_language_olog, replace) 
margins, at(ins4cat=(1 2 3 4) language=(0 1)) predict(outcome(secession)) pwcompare

gsem (ins4cat language ancestry_cont $controls -> secession, family(bernoulli) link(logit)) 
margins, at(ins4cat=(1 2 3 4) ancestry_cont=(0 0.5 1)) predict(outcome(secession))
marginsplot, title("Ancestry", size(medlarge)) xlabel(1 `""More Spanish" "than Catalan""' 2 `""Dual" "identity""' 3 `""More Catalan" "than Spanish""' 4 `""Only" "Catalan""') xtitle("Identity", height(4))  ytitle("Support for secession", size(small) height(3)) legend(order(0 "Parents born:" 4 "Outside Catalonia" 5 "One parent Catalonia" 6 "Catalonia") pos(6) row(2)) name(secession_ancestry_olog, replace) 
margins, at(ins4cat=(1 2 3 4) ancestry_cont=(0 1)) predict(outcome(secession)) pwcompare 
 
graph combine secession_language_olog secession_ancestry_olog, title("Support for secession", size(medsmall)) name(combine_secession_olog, replace)

graph combine combine_identity_olog combine_secession_olog, xsize(4) ysize(4) col(1) name(combine_combine, replace)
graph export figureA43a.png, replace
graph close
 
**Table A4.3b. Percentage of indirect effects for the fitted model for the language and the ancestry_cont, using an ordinal measure of national-regional identity
quiet gsem $sem1ord $cluster
foreach var of varlist language ancestry_cont {
*indirect language
nlcom _b[ins4cat:`var']*_b[secession:ins4cat]
*direct language
nlcom _b[secession:`var']
*total language
nlcom (_b[ins4cat:`var']*_b[secession:ins4cat]) + (_b[secession:`var'])
*% indirect language
nlcom  (_b[ins4cat:`var']*_b[secession:ins4cat]) / ((_b[ins4cat:`var']*_b[secession:ins4cat]) + (_b[secession:`var']))
}

***Table A4.4a. Percentage of indirect effects for the fitted model for the language (4 categories)
gsem (lang4_4 -> 2.ins4cat, family(multinomial) link(logit)) (lang4_4 -> 3.ins4cat, family(multinomial) link(logit)) (lang4_4 -> secession, family(bernoulli) link(logit)) (lang4_4 -> 4.ins4cat, family(multinomial) link(logit)) (2.ins4cat -> secession, family(bernoulli) link(logit)) (speak_cat -> secession, family(bernoulli) link(logit)) (ancestry_cont -> lang4_4, family(bernoulli) link(logit)) (ancestry_cont -> 2.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> 3.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> lang4_3, family(bernoulli) link(logit)) (ancestry_cont -> secession, family(bernoulli) link(logit)) (ancestry_cont -> 4.ins4cat, family(multinomial) link(logit)) (ancestry_cont -> lang4_2, family(bernoulli) link(logit)) (3.ins4cat -> secession, family(bernoulli) link(logit)) (2.education -> secession, family(bernoulli) link(logit)) (ideol -> secession, family(bernoulli) link(logit)) (female -> secession, family(bernoulli) link(logit)) (lang4_3 -> 2.ins4cat, family(multinomial) link(logit)) (lang4_3 -> 3.ins4cat, family(multinomial) link(logit)) (lang4_3 -> secession, family(bernoulli) link(logit)) (lang4_3 -> 4.ins4cat, family(multinomial) link(logit)) (age -> secession, family(bernoulli) link(logit)) (4.ins4cat -> secession, family(bernoulli) link(logit)) (3.education -> secession, family(bernoulli) link(logit)) (lang4_2 -> 2.ins4cat, family(multinomial) link(logit)) (lang4_2 -> 3.ins4cat, family(multinomial) link(logit)) (lang4_2 -> secession, family(bernoulli) link(logit)) (lang4_2 -> 4.ins4cat, family(multinomial) link(logit)), vce(cluster BOP_NUM) nocapslatent

*lang4_3 lang4_4

foreach var of varlist lang4_2  {
forvalues i=2/4 {
*indirect language
nlcom _b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]
*direct language
nlcom _b[secession:`var']
*total language
nlcom (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var'])
*% indirect language
nlcom  (_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) / ((_b[`i'.ins4cat:`var']*_b[secession:`i'.ins4cat]) + (_b[secession:`var']))
}
}

***Section A4.5. Non-recursive model with LPM
*Extremely unstable model so we need to rely on LPM with no controls
*SEM with controls
sem (language -> ins01, ) (language -> secession, ) (ins01 -> secession, ) (speak_cat -> secession, ) (ancestry_cont -> language, ) (ancestry_cont -> ins01, ) (ancestry_cont -> secession, ) (education -> secession, ) (ideol -> secession, ) (female -> secession, ) (secession -> ins01, ) (age -> secession, ) , vce(cluster BOP_NUM) nocapslatent
estat stable // Model NOT STABLE

*SEM without controls
sem (language -> ins01_5, ) (language -> secession, ) (ins01_5 -> secession, ) (ancestry_cont -> language, ) (ancestry_cont -> ins01_5, ) (ancestry_cont -> secession, ) (secession -> ins01_5, ), vce(cluster BOP_NUM) nocapslatent
estat teffects
foreach var in language ancestry_cont {
nlcom  (_b[ins01_5:`var']*_b[secession:ins01_5]) / ((_b[ins01_5:`var']*_b[secession:ins01_5]) + (_b[secession:`var']))
}
estat stable // Model STABLE

*SEM without controls and non-recursive: benchmark for comparison
sem (language -> ins01_5, ) (language -> secession, ) (ins01_5 -> secession, ) (ancestry_cont -> language, ) (ancestry_cont -> ins01_5, ) (ancestry_cont -> secession, ) , vce(cluster BOP_NUM) nocapslatent
estat teffects
foreach var in language ancestry_cont {
nlcom  (_b[ins01_5:`var']*_b[secession:ins01_5]) / ((_b[ins01_5:`var']*_b[secession:ins01_5]) + (_b[secession:`var']))
}
estat stable

********

*SEM without controls
sem (language -> ins01_5, ) (language -> secession, ) (ins01_5 -> secession, ) (ancestry_cont -> language, ) (ancestry_cont -> ins01_5, ) (ancestry_cont -> secession, ) (secession -> ins01_5, ), vce(cluster BOP_NUM) nocapslatent
estat teffects
foreach var in language ancestry_cont {
nlcom  (_b[ins01_5:`var']*_b[secession:ins01_5]) / ((_b[ins01_5:`var']*_b[secession:ins01_5]) + (_b[secession:`var']))
}
estat stable // Model STABLE

*SEM without controls and non-recursive: benchmark for comparison
sem (language -> ins01_5, ) (language -> secession, ) (ins01_5 -> secession, ) (ancestry_cont -> language, ) (ancestry_cont -> ins01_5, ) (ancestry_cont -> secession, ) , vce(cluster BOP_NUM) nocapslatent
estat teffects
foreach var in language ancestry_cont {
nlcom  (_b[ins01_5:`var']*_b[secession:ins01_5]) / ((_b[ins01_5:`var']*_b[secession:ins01_5]) + (_b[secession:`var']))
}
estat stable

***Section A4.6. Decomposition effects
*Language
ldecomp secession ancestry_cont ideol speak_cat female age education, d(language ) i(ins4cat1 ins4cat2 ins4cat3 ins4cat4 ) rindirect obspr cluster(BOP_NUM)

*ancestry (categorical)
ldecomp secession language ideol speak_cat female age education, d(ancestry2) i(ins4cat1 ins4cat2 ins4cat3 ins4cat4) rindirect obspr cluster(BOP_NUM)

******** END DO-FILE
